package edu.uwaterloo.bicyclecomputer;

import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JButton;
import java.awt.BorderLayout;
import javax.swing.JPanel;
import java.awt.GridLayout;
import javax.swing.JLabel;
import javax.swing.BoxLayout;
import java.awt.FlowLayout;
import java.awt.Font;
import net.miginfocom.swing.MigLayout;
import javax.swing.SwingConstants;
import java.awt.Color;

public class UI {

	private JFrame frmBicycleComputer;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					UI window = new UI();
					window.frmBicycleComputer.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public UI() {
		initialize();
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frmBicycleComputer = new JFrame();
		frmBicycleComputer.setResizable(false);
		frmBicycleComputer.setTitle("Bicycle Computer");
		frmBicycleComputer.setBounds(100, 100, 326, 294);
		frmBicycleComputer.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		
		JPanel panel = new JPanel();
		frmBicycleComputer.getContentPane().add(panel, BorderLayout.SOUTH);
		
		JButton btnMode = new JButton("Mode");
		btnMode.setFont(new Font("Tahoma", Font.PLAIN, 20));
		panel.add(btnMode);
		
		JButton btnStartstop = new JButton("Start/Stop");
		btnStartstop.setFont(new Font("Tahoma", Font.PLAIN, 20));
		panel.add(btnStartstop);
		
		JButton btnReset = new JButton("Reset");
		btnReset.setFont(new Font("Tahoma", Font.PLAIN, 20));
		panel.add(btnReset);
		
		JPanel panel_1 = new JPanel();
		frmBicycleComputer.getContentPane().add(panel_1, BorderLayout.CENTER);
		panel_1.setLayout(null);
		
		JLabel speedLbl = new JLabel("20");
		speedLbl.setForeground(new Color(128, 128, 128));
		speedLbl.setFont(new Font("Tahoma", Font.PLAIN, 180));
		speedLbl.setHorizontalAlignment(SwingConstants.RIGHT);
		speedLbl.setBounds(10, 11, 196, 152);
		panel_1.add(speedLbl);
		
		JLabel lblKmhr = new JLabel("KM/HR");
		lblKmhr.setForeground(new Color(25, 25, 112));
		lblKmhr.setFont(new Font("Tahoma", Font.PLAIN, 30));
		lblKmhr.setVerticalAlignment(SwingConstants.BOTTOM);
		lblKmhr.setBounds(216, 11, 94, 152);
		panel_1.add(lblKmhr);
		
		JLabel lblTm = new JLabel("MXS");
		lblTm.setForeground(new Color(25, 25, 112));
		lblTm.setFont(new Font("Tahoma", Font.PLAIN, 50));
		lblTm.setHorizontalAlignment(SwingConstants.RIGHT);
		lblTm.setBounds(10, 164, 98, 48);
		panel_1.add(lblTm);
		
		JLabel label = new JLabel("01.01.01");
		label.setForeground(new Color(128, 128, 128));
		label.setHorizontalAlignment(SwingConstants.RIGHT);
		label.setFont(new Font("Tahoma", Font.PLAIN, 50));
		label.setBounds(118, 164, 192, 48);
		panel_1.add(label);
	}
}
